{include file="index@public/header" /}
<style>
body {
    background: #e1e0de;
}
* {
    box-sizing: border-box;
}
h1,
h2,
h3,
h4 {
    font-weight: 700 !important;
}
.layui-card-header {
    width: 100%;
    border-bottom: 1px solid #999 !important;
    padding-left: 5px;
}
.layui-card {
    padding: 10px 20px 50px;
}
.layui-container {
    padding: 0 !important;
}
.layui-breadcrumb {
    padding-left: 5px;
}
.layui-card h1 {
    margin: 10px auto 0;
}
.layui-card-body{
    padding: 10px 5px;
}

.Interchange {
    margin: 10px 0px 0px 0px;
}

.key_filter {
    width: 300px;
    height: 30px;
    border-radius: 20px;
    outline: none;
    border: 1px solid #aaa;
    padding-left: 10px;
    margin: 0 0 5px;
}

#backtop {
    width: 55px;
    height: 48px;
    background: rgba(0, 0, 0, 0.3);
    color: #fff;
    text-align: center;
    border-radius: 2px;
    border: none;
    box-shadow: none;
    position: fixed;
    top: 40%;
    right: 10px;
    cursor: pointer;
    line-height: 18px;
}
table{
    border-color: #ddd;
    width: 100%;
}
th{  
    background-color: #428bca;
    color: #fff;
    padding: 5px 2px;
}
td{
    text-align: center;
    color: #333;
    padding: 5px 2px;
}

</style>
<div class="layui-container">
    <div class="layui-card" style='font: 12px/14px arial,helvetica,sans-serif;'>
        <span class="layui-breadcrumb" lay-separator="/">
            <a href="/" style="font: 12px/14px arial,helvetica,sans-serif;">{:lang('Home')}</a>
          {foreach $crumbs as $k=>$v }
          
          <a href="/resources/{$v['crumbs_url']}" style="font: 12px/14px arial,helvetica,sans-serif;color:#36648A">{$v['cname']}</a>
          
          {/foreach}
            <a style="font: 12px/14px arial,helvetica,sans-serif;color:#36648A"><cite>NMB</cite></a>
        </span>

        <div>
            <div class="layui-card-header" >
                <h1>NMB Cross Reference Charts</h1>
            </div>
            <div class="Interchange">
                <input id="Interchange_filter" class="key_filter" type="text" placeholder="Enter NMB Part Number such as “{$lily_cross[0]['part_number']}”" />
            </div>
            
            <div style="margin-top: -20px;">
                <a style="float:right;cursor: pointer;" href="/index/Cross/pdf?cb_id=2"><div class="layui-inline" style="font-size:12px;color:#333">Export Pdf <i class="layui-icon layui-icon-export" style="font-size:24px;color: #36648a;"></i></div></a>
                <div style="clear:both"></div>
                <div id="tab">
                <table width="100%" border="1" cellpadding="1" cellspacing="1">
                    <thead>
                    <tr>
                        <th>LILY</th>
                        <th>NMB</th>
                        <?php if(!empty($title_data)){?>
                        {foreach $title_data as $k=>$v }
                        <th>{$v['name']}</th>
                        {/foreach}
                        <?php } ?>
                    </tr>
                    </thead>
                    <tbody>
                    {foreach $lily_cross as $k=>$v }
                    <tr>
                        <td><a href="/products/{$v['url_product']}/">{$v['part_number']}</a></td>
                        <td>{$v['cross_number']}</td>

                        <?php if(!empty($v['other_brand'])){?>
                        {foreach $v['other_brand'] as $k1=>$v1 }
                        <?php if(!empty($v1['part_number'])){?>
                        <td>{$v1['part_number']}</td>
                        <?php }else{ ?>
                        <td>-</td>
                        <?php } ?>
                        {/foreach}
                        <?php } ?>
                        
                    </tr>
                    {/foreach}
                    </tbody>
                </table>
                </div>
            </div>
        </div>

    </div>
</div>

<div id="backtop" onclick="backtop()" class="icon-angle-up">
    <i class="layui-icon layui-icon-up"></i>
    <div style="font-size: 0.9em;">Top</div>
</div>  
{include file="index@public/footer" /}
<script>
/*回顶部*/
function backtop() {
    $("html,body").animate({ scrollTop: "0px" }, 500);
}
$(window).scroll(function() {
    var scrollTop=$(document).scrollTop();/*滚动距离*/
    if(scrollTop>360){
        $('#backtop').css({display:'block'});
    }else{
        $('#backtop').css({display:'none'});
    }
})    

$("#Interchange_filter").keyup(function () {
    $("table tbody tr").hide().filter(":contains('" + ($(this).val().toUpperCase()) + "')").show(); //，将符合条件的筛选出来
});

function cross_export_pdf(cb_id){
    $.post("{:url('index/Cross/pdf')}",{cb_id:cb_id},function(res){})
}
</script>